import 'package:flutter/material.dart';
import 'package:flutter_crud_test_amir_rabbani/core/config/theme_data.dart';
import 'package:flutter_crud_test_amir_rabbani/routes/app_pages.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';

import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_libphonenumber/flutter_libphonenumber.dart';

Future<void> main() async {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return FutureBuilder(
      future: init(),
      builder: (BuildContext context, AsyncSnapshot snapshot) {
        return GetMaterialApp(
          builder: EasyLoading.init(),
          initialRoute: AppPages.INITIAL,
          locale: const Locale('en'),
          // initialBinding: InitBinding(),
          supportedLocales: const [
            Locale('en'),
          ],
          theme: ThemeConfig.lightTheme,
          // darkTheme: ThemeConfig.darkTheme,
          themeMode: ThemeMode.light,
          localizationsDelegates: const [
            AppLocalizations.delegate,
            GlobalMaterialLocalizations.delegate,
            GlobalWidgetsLocalizations.delegate,
            GlobalCupertinoLocalizations.delegate,
          ],
          getPages: AppPages.routes,
        );
      },
    );
  }
}
